﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Gugu.management.AutoIT;
using Gugu.management.Excel;

namespace Gugu.management
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var appDir = AppDomain.CurrentDomain.BaseDirectory;
            var dir = new DirectoryInfo(appDir).Parent;
            List<Account> accounts = Reader.ReadExcell(dir.FullName + @"\data\account.xlsx");
            var account = accounts.First(p => p.Enable);
            var param = new List<string>();
            param.Add(account.UserName);
            param.Add(account.Password);
            var process = new ExeProcess("LogInFB",new List<string>(param));
            process.Run();
        }

        private void button2_Click(object sender, EventArgs e)
        {


        }
  
    }
}
